Telegram Group & Telegram Channel
👣 “Cheating the Reaper in Go” от Miguel Young

В этой подробной статье автор показывает, как «обмануть» сборщик мусора Go и создать свой собственный arena-аллокатор на чистом Go, получая существенный прирост производительности.

📌 Что внутри:
- Краткий обзор GC Go: как используются pointer bits и shapes для точного сбора мусора.

- Реализация простого bump-аллокатора Arena, сводящего Alloc к смещению указателя.

- Бенчмарки: до 2×–4× ускорения при малых аллокациях и почти 7× для массивов из 64 элементов ( arena – 7370 MB/s vs new – 2865 MB/s )
mcyoung.xyz
.

- Оптимизация через sync.Pool и финализаторы для повторного использования и ускоренного обнуления памяти.

- Безопасный метод Reset() для мгновенной очистки арены без дорогостоящего выделения заново.

Заготовка примитивного Realloc(), позволяющая расширять последние аллокации «на месте».

Полный код, подробное объяснение и советы по дальнейшим оптимизациям — по ссылке:
https://mcyoung.xyz/2025/04/21/go-arenas/

@golang_books
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/golang_books/969
Create:
Last Update:

👣 “Cheating the Reaper in Go” от Miguel Young

В этой подробной статье автор показывает, как «обмануть» сборщик мусора Go и создать свой собственный arena-аллокатор на чистом Go, получая существенный прирост производительности.

📌 Что внутри:
- Краткий обзор GC Go: как используются pointer bits и shapes для точного сбора мусора.

- Реализация простого bump-аллокатора Arena, сводящего Alloc к смещению указателя.

- Бенчмарки: до 2×–4× ускорения при малых аллокациях и почти 7× для массивов из 64 элементов ( arena – 7370 MB/s vs new – 2865 MB/s )
mcyoung.xyz
.

- Оптимизация через sync.Pool и финализаторы для повторного использования и ускоренного обнуления памяти.

- Безопасный метод Reset() для мгновенной очистки арены без дорогостоящего выделения заново.

Заготовка примитивного Realloc(), позволяющая расширять последние аллокации «на месте».

Полный код, подробное объяснение и советы по дальнейшим оптимизациям — по ссылке:
https://mcyoung.xyz/2025/04/21/go-arenas/

@golang_books

BY Golang Books




Share with your friend now:
tg-me.com/golang_books/969

View MORE
Open in Telegram


Golang Books Telegram | DID YOU KNOW?

Date: |

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

Telegram auto-delete message, expiring invites, and more

elegram is updating its messaging app with options for auto-deleting messages, expiring invite links, and new unlimited groups, the company shared in a blog post. Much like Signal, Telegram received a burst of new users in the confusion over WhatsApp’s privacy policy and now the company is adopting features that were already part of its competitors’ apps, features which offer more security and privacy. Auto-deleting messages were already possible in Telegram’s encrypted Secret Chats, but this new update for iOS and Android adds the option to make messages disappear in any kind of chat. Auto-delete can be enabled inside of chats, and set to delete either 24 hours or seven days after messages are sent. Auto-delete won’t remove every message though; if a message was sent before the feature was turned on, it’ll stick around. Telegram’s competitors have had similar features: WhatsApp introduced a feature in 2020 and Signal has had disappearing messages since at least 2016.

Golang Books from jp


Telegram Golang Books
FROM USA